	<script src="../lokesh-lightbox2-a9e6453/js/jquery-1.7.2.min.js"></script>
	<script src="../lokesh-lightbox2-a9e6453/js/lightbox.js"></script>
	<?php include ("checkLanguage.php");?>
	<h1>Kategorie: <?=$this->aDisplayedContent['title']?></h1>
	<p></p>
	
	<?php $aProduct = $this->aDisplayedContent['content'];
	$aProductImages = $this->aDisplayedContent['images']?>
	
	<h2><?=$aProduct['name']?></h2><form 
			action="index.php?co=product&method=deleteProduct&id=<?=$aProduct['id']?>"
			method="Post"><input type="submit" value="Produkt L&ouml;schen"
			class="submit" /></form>
			
			<br>
	
<form action="index.php?co=product&method=saveProduct&id=<?=$aProduct['id']?>"
	method="post">
	
	<table>
<tr> 
		<td colspan="6" align="right">Sprache ist: <input type="text"id="lid" style="font-size: 92%" name="lid" value="<?=$sDefaultS?>" size="7" disabled="disabled"></td>
		</tr>
		<tr><td><br></td></tr>
</table>
	
	<table border="0">
	<tr>
	<td colspan="2"><b>Allgemeines</b></td>
	</tr>
		<tr >
	<td rowspan="2">
	<a href="../image/<?=$aProduct['link']?>" rel="lightbox"><img src="../image/thumbs/<?=$aProduct['link']?>" border="0"></a>
	</td>
	<td>Produktbezeichnung</td>
	<td><input type="text" name="name"
			size="50" maxlength="50" class="text" value="<?=$aProduct['name']?>" /></td>
			</tr>
	<tr>
	<td>Kurzbeschreibung</td>
	<td><textarea name="short_description" cols="40" rows="2" maxlength="100"><?=$aProduct['short_description']?></textarea></td>
	</tr>
</table>
<br>
<table>
	<tr>
	<td>Langbeschreibung</td>
	</tr>
	<tr>
	<td colspan="2"><textarea rows="10" cols="100" name="long_description" maxlength="1000"><?=$aProduct['long_description']?></textarea></td>
	</tr>
	</table>
	
		
			<br>
	<p><b>Produktbilder</b></p>		
	<table cellspacing="15px">

<?php 
$iImagesPerRow = 5;
$iShownImages = 0;
$iArrayLength = count($aProductImages);
$iLoopBegin = 0;
$iLoopEnd = 0;

if($iArrayLength <= $iImagesPerRow){
    $iLoopEnd = $iArrayLength;
}else{
    $iLoopEnd = $iImagesPerRow;    
}

do{
?>
	<tr>
	 	<td>Hauptbild:</td>
	<?php 
	for($iBegin = $iLoopBegin, $iEnd = $iLoopEnd; $iBegin<$iEnd; $iBegin++){
	    $aImage = $aProductImages[$iBegin];
	?>
		    <td align="center">
			<input type="radio" name="mainimage" value="<?=$aImage['id'] ?>" <?php if ($aProduct['mainimage'] == $aImage['id']){echo "checked";}?>>
			</td>
		<?php }?>
	        </tr>
		<tr>
		<td></td>
	<?php 
	for($iBegin = $iLoopBegin, $iEnd = $iLoopEnd; $iBegin<$iEnd; $iBegin++){
	    $aImage = $aProductImages[$iBegin];
	?>
		    <td align="center">
			<a href="../image/<?=$aImage['link']?>" rel="lightbox"><img src="../image/thumbs/<?=$aImage['link']?>" border="0"></img></a>
			</td>
		<?php }?>
	        </tr>
	<tr>
	<td><form 
			action=""
			method="Post"></form></td>
			
	<?php 
	for($iBegin = $iLoopBegin, $iEnd = $iLoopEnd; $iBegin<$iEnd; $iBegin++){
	    $aImage = $aProductImages[$iBegin];
	?>
	    	<td align="center">
			<form 
			action="index.php?co=product&method=deleteImage&iid=<?=$aImage['id']?>"
			method="Post"><input type="submit" value="Bild L&ouml;schen"
			class="submit" /></form>
	

			</td>
	    <?php $iShownImages++;} ?>
		    
		</tr>
		<?php 
		$iLoopBegin = $iLoopEnd;
		if($iLoopEnd + $iImagesPerRow >= $iArrayLength){
		    $iLoopEnd = $iArrayLength;
		}else{
		    $iLoopEnd = $iLoopEnd + $iImagesPerRow;
		}
}while($iShownImages < $iArrayLength);
		?>
	</table>
	<table>
	<tr>
		<td colspan="3">
	    <form action="index.php?co=product&method=uploadProductImage&id=<?=$aProduct['id'] ?>" method="post" enctype="multipart/form-data">
Neues Bild: <input type="file" name="datei1"><br>
<input type="submit" value="Hochladen"><br>
</form>
	    </td>
	    </tr>
	</table>
	
	<table align="right">
	<tr>
	<td><input type="submit" name="saveProduct" value="&Auml;nderungen speichern"
	align="right" /></td></tr>
	</table>
	</form>
	
